package com.pet.admin.controller;


import com.pet.admin.mapper.ActivityMapper;
import com.pet.admin.mapper.AdminMapper;
import com.pet.admin.model.Activity;
import com.pet.admin.model.ActivityExample;
import com.pet.admin.model.AdminExample;
import com.pet.admin.util.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;


@RestController
public class ActivityController {
    @Autowired
    private ActivityMapper activityMapper;


    @RequestMapping(value="/deleteact",method = RequestMethod.POST)
    public String deleteact(HttpServletRequest request, Model model) throws ParseException {
        String id = request.getParameter("id");

        ActivityExample activityExample = new ActivityExample();

        activityExample.createCriteria().andIdEqualTo(Integer.parseInt(id));
        activityMapper.deleteByExample(activityExample);
        return "OK";
    }


}